package live.jialing.sip.base.service;

import live.jialing.core.data.LinkType;
import live.jialing.core.data.jpa.CustomJpaRepository;
import live.jialing.core.service.BaseDomainService;
import live.jialing.core.service.GeneralService;
import live.jialing.data.util.SpecificationUtil;
import live.jialing.sip.base.domain.Child;
import live.jialing.sip.base.repository.ChildRepository;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Map;

/**
 * 孩子
 */
@Service
public class ChildService extends BaseDomainService<Child, Long> implements GeneralService<Child, Long> {

    private static Logger logger = LoggerFactory.getLogger(ChildService.class);

    @Resource
    private ChildRepository childRepository;

    @Resource
    private ParentService parentService;

    @Override
    public CustomJpaRepository getRepository() {
        return this.childRepository;
    }

    public Specification<Child> buildSpecification(Class<Child> classz, Map<String, Object> searchParams, LinkType type) {

        return SpecificationUtil.buildSpecification(classz, searchParams, type);
    }
}
